<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		$(document.body).infinite().on('infinite', function() {
								if(loading) return;
								loading = true;
								sb++;
								if($('.weui-loadmore').attr('jiazai') == 0) {
									return false;
								}

								$.ajax({
										type: "get",
										url: 'http://cf.588net.com/index.php/api/Article/getList?page=' + sb,
										async: true,
										dataType: 'json',
										success: function(e) {
											var html = '';
											if(e.data.length == 0) {
												$('.weui-loadmore__tips').text('已经到底了哟！');
												$('.weui-loading').hide();
												$('.weui-loadmore').attr('jiazai', 0);
												return false;
											}

											if(e.code == 200) {
												$.each(e.data, function(a, b) {
														var ss = window.localStorage.getItem('dates');
														if(ss !== a) {
															html += '<div class="news-box">';
															html += '<h3 data-id="' + a + '">' + a + '</h3>';
															$.each(b, function(c, d) {
																//console.log(d);
																html += '<div class="news-list">';
																html += '<a href="news.html">';
																html += '<div class="new-text">';
																html += '<p class="news-info">' + d.title + '</p>';
																html += '<p class="review">' + d.username + '<span>' + '阅读数' + d.view + '</span></p></div>';
																html += '<div class="news-img">';
																html += '<img class="lazy" data-original="' + d.cover + '">';
																html += '</div>';
																html += '</a>';
																html += '</div>';
															})
															html += '</div>';
															$(html).insertBefore('.weui-loadmore');
														}
														window.localStorage.setItem('dates', a);
													}

												}

											}
										});

								})
	</body>
</html>
